// Body.h	class Body

#ifndef _KC_BODY__H_2008_KC_
#define _KC_BODY__H_2008_KC_

#include <iostream>
#include <string>
#include <stdexcept>
#include <unicode/unistr.h>
#include "MimeDefaults.h"
 
namespace kc_sf
{
	class BodyError : public std::logic_error
	{
		public:

			BodyError( const std::string &err )
			: std::logic_error( err ) {}
	};

	class BodyPart
	{
		public:

			BodyPart(const std::string &text);
			BodyPart(const std::string &text,
				EncodingType encoding,
				const std::string &charset);

			UnicodeString getDecodedText(); // lazy loading
			const std::string & getOriginalText() const;
			unsigned long getSize() const;

		private:

			std::string b_original_text;
			UnicodeString b_decoded_text;
			EncodingType b_encoding;
			std::string b_charset;
			unsigned long b_size;
	};

}

#endif // _KC_BODY__H_2008_KC_
